"""MISS URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.urls import path, include
from .views import *
from django.conf.urls.static import static
from django.conf import settings
from django.conf.urls import url


urlpatterns = [
    # 前台
    path('', index_front, name='index_front'),
    path('index/', index_front, name='index_front'),
    path('register/', register, name='register'),
    path('check_username/', check_username, name='check_username'),
    path('login_front/', login_front, name='login_front'),
    path('logout_front/', logout_front, name='logout_front'),
    path('products/', products_show, name='products_show'), # 商品展示
    path('single_product/', single_product, name='single_product'), # 单个商品页
    path('search/', search, name='search'),

    url(r'pay.html', pay, name='pay'),  # 支付页面
    url(r'^delete_item', delete_item),
    url(r'^change_item', change_item),
    path('user_center/', user_center, name='user_center'),
    path('user_info/', user_info, name='user_info'),
    path('user_address/', user_address, name='user_address'),
    path('user_address_add/', user_address_add, name='user_address_add'),
    path('user_payinfo', user_payinfo, name='user_payinfo'),
    path('order_submit/', order_submit, name='order_submit'),

    # 后台
    path('index_back/', index_back, name='index_back'),
    path('login_back/', login_back, name='login_back'),
    path('products_list/', products_list, name='products_list'),
    path('products_add/', products_add, name='products_add'),
    path('products_detail/', products_detail, name='products_detail'),
    path('products_delete/', products_delete, name='products_delete'),
    path('order_list/', order_list, name='order_list'),
    path('order_detail/', order_detail, name='order_detail'),
    path('user_list/', user_list, name='user_list'),
    path('user_add/', user_add, name='user_add'),
    path('user_detail/', user_detail, name='user_detail'),
    path('user_delete/', user_delete, name='user_delete'),
    path('user_rank/', user_rank, name='user_rank'),
    path('express_list/', express_list, name='express_list'),
    path('discharge_statistic/', discharge_statistic, name='discharge_statistic'),
    path('sales_volume/', sales_volume, name='sales_volume'),

] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

